﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AIProject.Pylos
{
    class RandomNumbers
    {
        private int[,] white;
        private int[,] black;
        private int[,] empty;

        private int[] whitePieces;
        private int[] blackPieces;
        private int blackToMove;
        private int whiteToMove;

        public int this[int i, int j]
        {
            get
            {
                if (i == 1)
                {
                    return this.whitePieces[j];
                }
                else
                {
                    return this.blackPieces[j];
                }
            }
            set
            {
            }
        }
        
        public int this[int i, int j, int k]
        {
            get
            {
                if (i == 1)
                {
                    return this.white[j, k];
                }
                else if (i == 2)
                {
                    return this.black[j, k];
                }
                else
                {
                    return this.empty[j, k];
                }
            }
            set
            {
            }
        }


        public int BlackToMove
        {
            get
            {
                return this.blackToMove;
            }
            set
            {
            }
        }

        public int WhiteToMove
        {
            get
            {
                return this.whiteToMove;
            }
            set
            {
            }
        }

        public RandomNumbers()
        {
            Random r = new Random();

            white = new int[4, 10];
            black = new int[4, 10];
            empty = new int[4, 10];
            whitePieces = new int[16];
            blackPieces = new int[16];

            blackToMove = r.Next(Int32.MaxValue);
            whiteToMove = r.Next(Int32.MaxValue);

            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    white[i, j] = r.Next(Int32.MaxValue);
                    black[i, j] = r.Next(Int32.MaxValue);
                    empty[i, j] = r.Next(Int32.MaxValue);
                }
            }

            for (int i = 0; i < 16; i++)
            {
                whitePieces[i] = r.Next(Int32.MaxValue);
                blackPieces[i] = r.Next(Int32.MaxValue);
            }
        }
    }
}
